#include<stdio.h>
int main()
{
    int n, i, j;
    while (scanf_s("%d", &n) != EOF)
    {
        for (i = 1; i <= n; i++)
        {
            if (i == 1 || i == n)
                for(j=1;j<=n;j++)
                printf("* ");
            else
            {
                printf("* ");
                for (j = 0; j < n - 2; j++)
                    printf("  ");
                printf("* \n");
            }
        }
    }
    return 0;
}